FROM  alpine:latest
RUN  mkdir -pv /app /data /config
COPY run.sh  /app/
COPY localtime  /etc/       
COPY zoneinfo  /usr/share/zoneinfo/
WORKDIR /app
RUN   sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories  &&  \
      apk add   curl wget &&  \
      chmod +x /app/run.sh &&  \
      app_name01=$(curl  -slf  http://iscute.cn/tar/chfs/| grep href|tail  -n 1 |awk   -F  '"'  '{print $2}'|sed   's/\///g')  && \
      app_name02=$(curl  -slf  http://iscute.cn/tar/chfs/${app_name01}/| egrep  'arm64|amd64'| grep  linux|awk   -F  '>' '{print  $1}' |awk   -F '"'  '{print  $2}'|xargs)  && \
      for var in ${app_name02} ; do  wget http://iscute.cn/tar/chfs/${app_name01}/${var}  $var  ;done || true
       
# 设置环境变量
ENV use_local_config "false"
ENV port "8080"
ENV path "/data"
ENV allow ""
ENV log /var/log/app.log
ENV html_title "Myfile"
ENV html_notice "Welcome to Myfile"
ENV image_preview "true"
ENV folder_download "enable"
ENV ssl_cert ""
ENV ssl_key ""
ENV session_timeout ""
ENV file_remove "3"
# 定义管理员账户变量
ENV user_name "admin"
ENV user_password "admin"
ENV user_rule_default "rwd"
ENV user_rule_none ""
ENV user_rule_r ""
ENV user_rule_w ""
ENV user_rule_d ""
# 定义访客账户变量
ENV guest_password ""
ENV guest_rule_default "r"
ENV guest_rule_none ""
ENV guest_rule_r ""
ENV guest_rule_w ""
ENV guest_rule_d ""



CMD ["sh","run.sh"]